import '@/assets/style/global.scss';
import { setupDirectives } from '@/directives';
import { setupLazy, setupMdPreview, setupViewer } from '@/plugins';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import 'lib-flexible-computer';
import 'virtual:svg-icons-register';
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import pinia from './store';

import * as ElementPlusIconsVue from '@element-plus/icons-vue';

const app = createApp(App);
// 全局注入element icon组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

setupLazy(app); // 图片懒加载插件
setupMdPreview(app); // markdown预览插件
setupDirectives(app); // 进入可视区域加载动画
setupViewer(app); // 图片查看器插件
app.use(router);
app.use(pinia);
app.use(ElementPlus);
app.mount('#app');
